3.4.6 \(\int \frac {(c+d x)^3}{x^2 (a+b x)^3} \, dx\) [306]

Optimal. Leaf size=112 \[ -\frac {c^3}{a^3 x}-\frac {(b c-a d)^3}{2 a^2 b^2 (a+b x)^2}-\frac {(b c-a d)^2 (2 b c+a d)}{a^3 b^2 (a+b x)}-\frac {3 c^2 (b c-a d) \log (x)}{a^4}+\frac {3 c^2 (b c-a d) \log (a+b x)}{a^4} \]

[Out]

-c^3/a^3/x-1/2*(-a*d+b*c)^3/a^2/b^2/(b*x+a)^2-(-a*d+b*c)^2*(a*d+2*b*c)/a^3/b^2/(b*x+a)-3*c^2*(-a*d+b*c)*ln(x)/
a^4+3*c^2*(-a*d+b*c)*ln(b*x+a)/a^4

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 112, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.056, Rules used = {90} \begin {gather*} -\frac {3 c^2 \log (x) (b c-a d)}{a^4}+\frac {3 c^2 (b c-a d) \log (a+b x)}{a^4}-\frac {(b c-a d)^2 (a d+2 b c)}{a^3 b^2 (a+b x)}-\frac {c^3}{a^3 x}-\frac {(b c-a d)^3}{2 a^2 b^2 (a+b x)^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d*x)^3/(x^2*(a + b*x)^3),x]

[Out]

-(c^3/(a^3*x)) - (b*c - a*d)^3/(2*a^2*b^2*(a + b*x)^2) - ((b*c - a*d)^2*(2*b*c + a*d))/(a^3*b^2*(a + b*x)) - (
3*c^2*(b*c - a*d)*Log[x])/a^4 + (3*c^2*(b*c - a*d)*Log[a + b*x])/a^4

Rule 90

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandI
ntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] &&
(IntegerQ[p] || (GtQ[m, 0] && GeQ[n, -1]))

Rubi steps

\begin {align*} \int \frac {(c+d x)^3}{x^2 (a+b x)^3} \, dx &=\int \left (\frac {c^3}{a^3 x^2}+\frac {3 c^2 (-b c+a d)}{a^4 x}-\frac {(-b c+a d)^3}{a^2 b (a+b x)^3}+\frac {(-b c+a d)^2 (2 b c+a d)}{a^3 b (a+b x)^2}-\frac {3 b c^2 (-b c+a d)}{a^4 (a+b x)}\right ) \, dx\\ &=-\frac {c^3}{a^3 x}-\frac {(b c-a d)^3}{2 a^2 b^2 (a+b x)^2}-\frac {(b c-a d)^2 (2 b c+a d)}{a^3 b^2 (a+b x)}-\frac {3 c^2 (b c-a d) \log (x)}{a^4}+\frac {3 c^2 (b c-a d) \log (a+b x)}{a^4}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.07, size = 106, normalized size = 0.95 \begin {gather*} \frac {-\frac {2 a c^3}{x}+\frac {a^2 (-b c+a d)^3}{b^2 (a+b x)^2}-\frac {2 a (b c-a d)^2 (2 b c+a d)}{b^2 (a+b x)}+6 c^2 (-b c+a d) \log (x)+6 c^2 (b c-a d) \log (a+b x)}{2 a^4} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x)^3/(x^2*(a + b*x)^3),x]

[Out]

((-2*a*c^3)/x + (a^2*(-(b*c) + a*d)^3)/(b^2*(a + b*x)^2) - (2*a*(b*c - a*d)^2*(2*b*c + a*d))/(b^2*(a + b*x)) +
 6*c^2*(-(b*c) + a*d)*Log[x] + 6*c^2*(b*c - a*d)*Log[a + b*x])/(2*a^4)

________________________________________________________________________________________

Maple [A]
time = 0.09, size = 145, normalized size = 1.29

method result size
norman \(\frac {\frac {\left (3 a^{2} d^{2} c -6 a b \,c^{2} d +6 b^{2} c^{3}\right ) x^{2}}{a^{3}}-\frac {c^{3}}{a}+\frac {\left (a^{3} d^{3}+3 a^{2} b c \,d^{2}-9 a \,b^{2} c^{2} d +9 b^{3} c^{3}\right ) x^{3}}{2 a^{4}}}{x \left (b x +a \right )^{2}}+\frac {3 c^{2} \left (a d -b c \right ) \ln \left (x \right )}{a^{4}}-\frac {3 c^{2} \left (a d -b c \right ) \ln \left (b x +a \right )}{a^{4}}\) \(139\)
default \(-\frac {a^{3} d^{3}-3 a \,b^{2} c^{2} d +2 b^{3} c^{3}}{a^{3} b^{2} \left (b x +a \right )}-\frac {-a^{3} d^{3}+3 a^{2} b c \,d^{2}-3 a \,b^{2} c^{2} d +b^{3} c^{3}}{2 b^{2} a^{2} \left (b x +a \right )^{2}}-\frac {3 c^{2} \left (a d -b c \right ) \ln \left (b x +a \right )}{a^{4}}-\frac {c^{3}}{a^{3} x}+\frac {3 c^{2} \left (a d -b c \right ) \ln \left (x \right )}{a^{4}}\) \(145\)
risch \(\frac {-\frac {\left (a^{3} d^{3}-3 a \,b^{2} c^{2} d +3 b^{3} c^{3}\right ) x^{2}}{a^{3} b}-\frac {\left (a^{3} d^{3}+3 a^{2} b c \,d^{2}-9 a \,b^{2} c^{2} d +9 b^{3} c^{3}\right ) x}{2 a^{2} b^{2}}-\frac {c^{3}}{a}}{x \left (b x +a \right )^{2}}+\frac {3 c^{2} \ln \left (-x \right ) d}{a^{3}}-\frac {3 c^{3} \ln \left (-x \right ) b}{a^{4}}-\frac {3 c^{2} \ln \left (b x +a \right ) d}{a^{3}}+\frac {3 c^{3} \ln \left (b x +a \right ) b}{a^{4}}\) \(160\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)^3/x^2/(b*x+a)^3,x,method=_RETURNVERBOSE)

[Out]

-(a^3*d^3-3*a*b^2*c^2*d+2*b^3*c^3)/a^3/b^2/(b*x+a)-1/2*(-a^3*d^3+3*a^2*b*c*d^2-3*a*b^2*c^2*d+b^3*c^3)/b^2/a^2/
(b*x+a)^2-3*c^2*(a*d-b*c)/a^4*ln(b*x+a)-c^3/a^3/x+3*c^2*(a*d-b*c)/a^4*ln(x)

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 164, normalized size = 1.46 \begin {gather*} -\frac {2 \, a^{2} b^{2} c^{3} + 2 \, {\left (3 \, b^{4} c^{3} - 3 \, a b^{3} c^{2} d + a^{3} b d^{3}\right )} x^{2} + {\left (9 \, a b^{3} c^{3} - 9 \, a^{2} b^{2} c^{2} d + 3 \, a^{3} b c d^{2} + a^{4} d^{3}\right )} x}{2 \, {\left (a^{3} b^{4} x^{3} + 2 \, a^{4} b^{3} x^{2} + a^{5} b^{2} x\right )}} + \frac {3 \, {\left (b c^{3} - a c^{2} d\right )} \log \left (b x + a\right )}{a^{4}} - \frac {3 \, {\left (b c^{3} - a c^{2} d\right )} \log \left (x\right )}{a^{4}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^3/x^2/(b*x+a)^3,x, algorithm="maxima")

[Out]

-1/2*(2*a^2*b^2*c^3 + 2*(3*b^4*c^3 - 3*a*b^3*c^2*d + a^3*b*d^3)*x^2 + (9*a*b^3*c^3 - 9*a^2*b^2*c^2*d + 3*a^3*b
*c*d^2 + a^4*d^3)*x)/(a^3*b^4*x^3 + 2*a^4*b^3*x^2 + a^5*b^2*x) + 3*(b*c^3 - a*c^2*d)*log(b*x + a)/a^4 - 3*(b*c
^3 - a*c^2*d)*log(x)/a^4

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 284 vs. \(2 (110) = 220\).
time = 0.73, size = 284, normalized size = 2.54 \begin {gather*} -\frac {2 \, a^{3} b^{2} c^{3} + 2 \, {\left (3 \, a b^{4} c^{3} - 3 \, a^{2} b^{3} c^{2} d + a^{4} b d^{3}\right )} x^{2} + {\left (9 \, a^{2} b^{3} c^{3} - 9 \, a^{3} b^{2} c^{2} d + 3 \, a^{4} b c d^{2} + a^{5} d^{3}\right )} x - 6 \, {\left ({\left (b^{5} c^{3} - a b^{4} c^{2} d\right )} x^{3} + 2 \, {\left (a b^{4} c^{3} - a^{2} b^{3} c^{2} d\right )} x^{2} + {\left (a^{2} b^{3} c^{3} - a^{3} b^{2} c^{2} d\right )} x\right )} \log \left (b x + a\right ) + 6 \, {\left ({\left (b^{5} c^{3} - a b^{4} c^{2} d\right )} x^{3} + 2 \, {\left (a b^{4} c^{3} - a^{2} b^{3} c^{2} d\right )} x^{2} + {\left (a^{2} b^{3} c^{3} - a^{3} b^{2} c^{2} d\right )} x\right )} \log \left (x\right )}{2 \, {\left (a^{4} b^{4} x^{3} + 2 \, a^{5} b^{3} x^{2} + a^{6} b^{2} x\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^3/x^2/(b*x+a)^3,x, algorithm="fricas")

[Out]

-1/2*(2*a^3*b^2*c^3 + 2*(3*a*b^4*c^3 - 3*a^2*b^3*c^2*d + a^4*b*d^3)*x^2 + (9*a^2*b^3*c^3 - 9*a^3*b^2*c^2*d + 3
*a^4*b*c*d^2 + a^5*d^3)*x - 6*((b^5*c^3 - a*b^4*c^2*d)*x^3 + 2*(a*b^4*c^3 - a^2*b^3*c^2*d)*x^2 + (a^2*b^3*c^3
- a^3*b^2*c^2*d)*x)*log(b*x + a) + 6*((b^5*c^3 - a*b^4*c^2*d)*x^3 + 2*(a*b^4*c^3 - a^2*b^3*c^2*d)*x^2 + (a^2*b
^3*c^3 - a^3*b^2*c^2*d)*x)*log(x))/(a^4*b^4*x^3 + 2*a^5*b^3*x^2 + a^6*b^2*x)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 262 vs. \(2 (100) = 200\).
time = 0.86, size = 262, normalized size = 2.34 \begin {gather*} \frac {- 2 a^{2} b^{2} c^{3} + x^{2} \left (- 2 a^{3} b d^{3} + 6 a b^{3} c^{2} d - 6 b^{4} c^{3}\right ) + x \left (- a^{4} d^{3} - 3 a^{3} b c d^{2} + 9 a^{2} b^{2} c^{2} d - 9 a b^{3} c^{3}\right )}{2 a^{5} b^{2} x + 4 a^{4} b^{3} x^{2} + 2 a^{3} b^{4} x^{3}} + \frac {3 c^{2} \left (a d - b c\right ) \log {\left (x + \frac {3 a^{2} c^{2} d - 3 a b c^{3} - 3 a c^{2} \left (a d - b c\right )}{6 a b c^{2} d - 6 b^{2} c^{3}} \right )}}{a^{4}} - \frac {3 c^{2} \left (a d - b c\right ) \log {\left (x + \frac {3 a^{2} c^{2} d - 3 a b c^{3} + 3 a c^{2} \left (a d - b c\right )}{6 a b c^{2} d - 6 b^{2} c^{3}} \right )}}{a^{4}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)**3/x**2/(b*x+a)**3,x)

[Out]

(-2*a**2*b**2*c**3 + x**2*(-2*a**3*b*d**3 + 6*a*b**3*c**2*d - 6*b**4*c**3) + x*(-a**4*d**3 - 3*a**3*b*c*d**2 +
 9*a**2*b**2*c**2*d - 9*a*b**3*c**3))/(2*a**5*b**2*x + 4*a**4*b**3*x**2 + 2*a**3*b**4*x**3) + 3*c**2*(a*d - b*
c)*log(x + (3*a**2*c**2*d - 3*a*b*c**3 - 3*a*c**2*(a*d - b*c))/(6*a*b*c**2*d - 6*b**2*c**3))/a**4 - 3*c**2*(a*
d - b*c)*log(x + (3*a**2*c**2*d - 3*a*b*c**3 + 3*a*c**2*(a*d - b*c))/(6*a*b*c**2*d - 6*b**2*c**3))/a**4

________________________________________________________________________________________

Giac [A]
time = 0.82, size = 161, normalized size = 1.44 \begin {gather*} -\frac {3 \, {\left (b c^{3} - a c^{2} d\right )} \log \left ({\left | x \right |}\right )}{a^{4}} + \frac {3 \, {\left (b^{2} c^{3} - a b c^{2} d\right )} \log \left ({\left | b x + a \right |}\right )}{a^{4} b} - \frac {2 \, a^{3} b^{2} c^{3} + 2 \, {\left (3 \, a b^{4} c^{3} - 3 \, a^{2} b^{3} c^{2} d + a^{4} b d^{3}\right )} x^{2} + {\left (9 \, a^{2} b^{3} c^{3} - 9 \, a^{3} b^{2} c^{2} d + 3 \, a^{4} b c d^{2} + a^{5} d^{3}\right )} x}{2 \, {\left (b x + a\right )}^{2} a^{4} b^{2} x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^3/x^2/(b*x+a)^3,x, algorithm="giac")

[Out]

-3*(b*c^3 - a*c^2*d)*log(abs(x))/a^4 + 3*(b^2*c^3 - a*b*c^2*d)*log(abs(b*x + a))/(a^4*b) - 1/2*(2*a^3*b^2*c^3
+ 2*(3*a*b^4*c^3 - 3*a^2*b^3*c^2*d + a^4*b*d^3)*x^2 + (9*a^2*b^3*c^3 - 9*a^3*b^2*c^2*d + 3*a^4*b*c*d^2 + a^5*d
^3)*x)/((b*x + a)^2*a^4*b^2*x)

________________________________________________________________________________________

Mupad [B]
time = 0.12, size = 169, normalized size = 1.51 \begin {gather*} \frac {6\,c^2\,\mathrm {atanh}\left (\frac {3\,c^2\,\left (a\,d-b\,c\right )\,\left (a+2\,b\,x\right )}{a\,\left (3\,b\,c^3-3\,a\,c^2\,d\right )}\right )\,\left (a\,d-b\,c\right )}{a^4}-\frac {\frac {c^3}{a}+\frac {x^2\,\left (a^3\,d^3-3\,a\,b^2\,c^2\,d+3\,b^3\,c^3\right )}{a^3\,b}+\frac {x\,\left (a^3\,d^3+3\,a^2\,b\,c\,d^2-9\,a\,b^2\,c^2\,d+9\,b^3\,c^3\right )}{2\,a^2\,b^2}}{a^2\,x+2\,a\,b\,x^2+b^2\,x^3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*x)^3/(x^2*(a + b*x)^3),x)

[Out]

(6*c^2*atanh((3*c^2*(a*d - b*c)*(a + 2*b*x))/(a*(3*b*c^3 - 3*a*c^2*d)))*(a*d - b*c))/a^4 - (c^3/a + (x^2*(a^3*
d^3 + 3*b^3*c^3 - 3*a*b^2*c^2*d))/(a^3*b) + (x*(a^3*d^3 + 9*b^3*c^3 - 9*a*b^2*c^2*d + 3*a^2*b*c*d^2))/(2*a^2*b
^2))/(a^2*x + b^2*x^3 + 2*a*b*x^2)

________________________________________________________________________________________